package com.zw.system.controller;/*
 *@program:java-cloud-prevalence
 *@author:
 *@Time: 2022/12/8  19:37
 *@description: 用户菜单feign接口
 */

import com.zw.object.vo.RouterVo;
import com.zw.system.service.SysMenuService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@Api(tags = "user-service feign调用")
@RestController
@RequestMapping("/admin/system/sysMenu")   ///admin/system/sysMenu/feignFindUserMenuList\
public class SysUserMenuController {
    @Autowired
    private SysMenuService sysMenuService;

    /**
     *                  根据用id获取按钮权限值
     * @param userId    参数用户ID
     * @return          List<String>
     */
    @ApiOperation("根据用户id获取按钮权限值")
    @RequestMapping("/findUserPermsList")
    public List<String> findUserPermsList(@RequestParam(value = "userId")String userId){
        return sysMenuService.findUserPermsList(userId);
    }

    /**
     *                  根据用户id获取菜单权限值
     * @param userId    参数用户ID
     * @return          List<Router>
     */
    @ApiOperation("根据用户id获取菜单权限值")
    @RequestMapping("/findUserMenuList")
    List<RouterVo> findUserMenuList(@RequestParam(value = "userId") String userId){
        return sysMenuService.findUserMenuList(userId);
    }
    /**
     *                  根据用户id获取菜单权限值
     * @param userId    参数用户ID
     * @return          List<Router>
     */
    @ApiOperation("根据用户id获取菜单权限值给Feign使用")
    @RequestMapping("/feignFindUserMenuList")   //feignFindUserMenuList
    List<String> findUserPermsListToFeign(@RequestParam(value = "userId") String userId){
        return sysMenuService.findUserPermsList(userId);
    }
}
